package com.stox.client.ui.core.event;

import com.stox.client.ui.javafx.chartingy.event.listener.ChartingEventListener;


public class EventPublisher {
	
	private static final SmartApplicationListener[] applicationListeners = {ChartingEventListener.INSTANCE};
	
	
	public static <T extends ApplicationEvent> void publishEvent(T event){
		for(SmartApplicationListener smartApplicationListener : applicationListeners){
			if(smartApplicationListener.supportsEventType(event.getClass()) && smartApplicationListener.supportsSourceType(event.getSource().getClass())){
				smartApplicationListener.onApplicationEvent(event);
			}
		}
	}
}
